package com.zlg.factory.factoryMethod2;

public class NYPizzaStore extends PizzaStore{
		Pizza pizza = null;
		PizzaIngredientFactory ingredientFactory = new NYPizzaIngredientFactory();
		
		Pizza createPizza(String type) {
			if(type.equals("cheese")) {
				pizza = new CheesePizza(ingredientFactory);
				pizza.setName("new york style cheese pizza");//后面各种类的披萨省略...
			}else if(type.equals("pepperoni")) {
				pizza = new CheesePizza(ingredientFactory);
				pizza.setName("new york style cheese pizza");
			}else if(type.equals("clam")) {
				pizza = new CheesePizza(ingredientFactory);
				pizza.setName("new york style cheese pizza");
			}else if(type.equals("veggie")){
				pizza = new CheesePizza(ingredientFactory);
				pizza.setName("new york style cheese pizza");
			}
			return pizza;
		}
}
